package net.xuele.learn.flink.example;

import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.lang.UUID;
import lombok.Data;
import lombok.ToString;
import org.springframework.util.JdkIdGenerator;

@Data
@ToString
public class Person {
    private int id;
    public String name;
    public Integer age;

    public Person() {
    }

    public Person(int id, String name, Integer age) {
        this.id = id;
        this.name = name;
        this.age = age;
    }

    public Person(String name, Integer age) {
        this.id = 0;
        this.name = name;
        this.age = age;
    }

    public static void main(String[] args) {
        long timestamp = System.currentTimeMillis();
        long windowSize = 1000 * 60 * 60;
        long offset = 1000 * 60 * 15;
        // 取整
//        long startTime = timestamp - (timestamp % windowSize);
        long l = (timestamp - offset + windowSize) % windowSize;
        long startTime = timestamp - l;
        long endTime = startTime + windowSize;
        System.out.println(timestamp + " ==== " + l + " ==== " + startTime + " ==== " + endTime);
        System.out.println(timestamp + (30000 - (timestamp % 30000)));
    }
}
